<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateAdherentTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_noCarte}" for="noCarte" />
                    <h:inputText id="noCarte" value="#{adherentController.selected.noCarte}" title="#{bundle.CreateAdherentTitle_noCarte}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_noCarte}"/>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_dateAdhesion}" for="dateAdhesion" />
                    <h:inputText id="dateAdhesion" value="#{adherentController.selected.dateAdhesion}" title="#{bundle.CreateAdherentTitle_dateAdhesion}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_dateAdhesion}">
                        <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_nomAdherent}" for="nomAdherent" />
                    <h:inputText id="nomAdherent" value="#{adherentController.selected.nomAdherent}" title="#{bundle.CreateAdherentTitle_nomAdherent}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_nomAdherent}"/>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_prenomAdherent}" for="prenomAdherent" />
                    <h:inputText id="prenomAdherent" value="#{adherentController.selected.prenomAdherent}" title="#{bundle.CreateAdherentTitle_prenomAdherent}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_prenomAdherent}"/>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_dateNaissance}" for="dateNaissance" />
                    <h:inputText id="dateNaissance" value="#{adherentController.selected.dateNaissance}" title="#{bundle.CreateAdherentTitle_dateNaissance}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_dateNaissance}">
                        <f:convertDateTime pattern="dd/MM/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_adresse}" for="adresse" />
                    <h:inputTextarea rows="2" cols="30" id="adresse" value="#{adherentController.selected.adresse}" title="#{bundle.CreateAdherentTitle_adresse}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_adresse}"/>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_lieuResidence}" for="lieuResidence" />
                    <h:selectOneMenu id="lieuResidence" value="#{adherentController.selected.lieuResidence}" title="#{bundle.CreateAdherentTitle_lieuResidence}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_lieuResidence}">
                        <f:selectItems value="#{lieuResidenceController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_login}" for="login" />
                    <h:inputText id="login" value="#{adherentController.selected.login}" title="#{bundle.CreateAdherentTitle_login}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_login}"/>
                    <h:outputLabel value="#{bundle.CreateAdherentLabel_initialPassword}" for="password" />
                    <h:inputText id="password" value="#{adherentController.selected.password}" title="#{bundle.CreateAdherentTitle_initialPassword}" required="true" requiredMessage="#{bundle.CreateAdherentRequiredMessage_initialPassword}"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{adherentController.create}" value="#{bundle.CreateAdherentSaveLink}" />
                <h:commandLink action="#{adherentController.prepareList}" value="#{bundle.CreateAdherentShowAllLink}" immediate="true"/>
                <h:commandLink value="#{bundle.CreateAdherentIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
